﻿//
//  Manyou.Toolkit.User.cs:
//  Authors:
//	Bryan Chow (cabir.zhou@gmail.com)
//
//
//  No Trademark License- This license does not grant you rights to use any 
//  contributors' name, logo, or trademarks.
//
//  If you bring a patent claim against any contributor over patents that you
//  claim are infringed by the software, your patent license from such 
//  contributor to the software ends automatically.
//
//  If you distribute any portion of the software, you must retain
//  all copyright, patent, trademark, and attribution notices that are present in the software.
//
//  If you distribute any portion of the software in source code form,
//  you may do so only under this license by including a complete copy of this license
//  with your distribution. If you distribute any portion of the software
//  in compiled or object code form, you may only do so under a license that complies with this license.
//
//  The software is licensed "as-is." You bear the risk of using it. 
//  The contributors give no express warranties, guarantees or conditions.
//  You may have additional consumer rights under your local laws which 
//  this license cannot change. To the extent permitted under your local laws,
//  the contributors exclude the implied warranties of merchantability,
//  fitness for a particular purpose and non-infringement.
//

using Newtonsoft.Json;

namespace Manyou.Toolkit
{
    /// <summary>
    /// 用户信息
    /// </summary>
    public class User : Friend
    {
        public static readonly string[] FIELDS = { "uid", "uch_id", "name", "handle", "site", 
			"sex", "birthday", "blood_type", "relationship_status", "current_location", "hometown_location", 
			"has_added_app", "admin_level", "pic" };

        [JsonPropertyAttribute("uch_id")]
        public string uch_id;
        public int UchId
        {
            get { return Util.GetIntFromString(uch_id); }
        }//uchuid

        [JsonPropertyAttribute("name")]
        public string Name;	//UCHome 开启实名机制时返回用户实名，没有开启时返回用户名（同 handle）。 

        [JsonPropertyAttribute("handle")]
        public string Handle;	//用户名 

        [JsonPropertyAttribute("site")]
        public string site;
        public int Site 
        {
            get { return Util.GetIntFromString(site); }
        }	//站点ID

        [JsonPropertyAttribute("sex")]
        public string Sex;  //用户性别，返回值为 male 或 famale

        [JsonPropertyAttribute("birthday")]
        public string Birthday;  //用户出生日期，返回值为 YYYY-MM-DD 格式，例如 1983-01-01

        [JsonPropertyAttribute("blood_type")]
        public string BloodType;  //用户血型

        [JsonPropertyAttribute("relationship_status")]
        public string RelationshipStatus;  //婚恋状态

        [JsonPropertyAttribute("current_location")]
        public string CurrentLocation;  //当前居住地

        [JsonPropertyAttribute("hometown_location")]
        public string HometownLocation;  //家乡

        [JsonPropertyAttribute("has_added_app")]
        public string has_added_app;
        public int HasAaddedApp
        {
            get { return Util.GetIntFromString(has_added_app); }
        }//是否安装了当前应用，返回 0 或 1

        [JsonPropertyAttribute("admin_level")]
        public string AdminLevel;	 //用户权限信息。返回值为 ‘USER’表示普通用户，‘MANAGER’表示为管理员，‘FOUNDER’表示创始人

        [JsonPropertyAttribute("pic")]
        public string Pic;	 //

        [JsonPropertyAttribute("pic_thumb")]
        public string ThumbPic;	 //

        [JsonPropertyAttribute("pic_small")]
        public string SmallPic;	 //

    }
}
